public class Cipher {
	
	public String encrypt(String toEncrypt){
		char[] test2 = toEncrypt.toCharArray();
		for(int i=0; i<test2.length; i++){
			if(test2[i]>=65 && test2[i]<=80)
				test2[i] += 35;
			else if(test2[i]>=81 && test2[i]<=90)
				test2[i] -= 16;
			else if(test2[i]>=48 && test2[i]<=57)
				test2[i] += 27;
			else if(test2[i]>=97 && test2[i]<=102)
				test2[i] -= 12;
			else if(test2[i]>=103 && test2[i]<=112)
				test2[i] -= 55;
			else if(test2[i]>=113 && test2[i]<=122)
				test2[i] -= 16;
		}
		String result = new String(test2);
		return result;
	}
	
	public String decrypt(String toDecrypt){
		char[] test4 = toDecrypt.toCharArray();
		for(int i=0; i<test4.length; i++){
			if(test4[i]>=65 && test4[i]<=74)
				test4[i] += 16;
			else if(test4[i]>=75 && test4[i]<=84)
				test4[i] -= 27;
			else if(test4[i]>=85 && test4[i]<=90)
				test4[i] += 12;
			else if(test4[i]>=48 && test4[i]<=57)
				test4[i] += 55;
			else if(test4[i]>=97 && test4[i]<=106)
				test4[i] += 16;
			else if(test4[i]>=107 && test4[i]<=122)
				test4[i] -= 35;
		}
		String result = new String(test4);
		return result;
		
	}
}
